<script type="text/javascript"> 
 
    $(document).ready(function(){ 
		// initialise Superfish 
        $("ul.sf-menu").superfish({ 
            pathClass:  'Contents' 
        }); 
        $("#tabs").tabs();
    }); 
 
</script>
<?php
$rightblocks = explode(";", $this->data['Content']['rightblocks']);
?>
<? 
$javascript->link(array('tiny_mce/tiny_mce'), false);

?>

<script language="javascript">
//JavaScript Document
tinyMCE.init({
	// General options
	mode : "exact",
	theme : "advanced",
	skin : "o2k7",
	cleanup: false,
	skin_variant : "silver",
	elements : "ContentEng, ContentRus, ContentArm ",
	plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
	 
	// Theme options
	theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect,|,forecolor,backcolor",
	theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview",
	theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
	theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : true,
	 
	// Example content CSS (should be your site CSS)
	content_css : "/css/CMS_styles.css",
	
	// Drop lists for link/image/media/template dialogs
	template_external_list_url : 	"<?=APP_ROOT?>/contents/getTinyTemplateList",
	external_link_list_url : 		"<?=APP_ROOT?>/contents/getTinyLinkList",
	external_image_list_url : 		"<?=APP_ROOT?>/contents/getTinyImageList/<?= $this->data['Content']['name']?>",
	media_external_list_url : 		"<?=APP_ROOT?>/contents/getTinySwfList",
	 
	// Replace values for the template plugin
	//template_replace_values : {
	//	username : "Some User",
	//	staffid : "991234"
	//}
});
	


</script>

<?php echo $form->create('Content');?>
	<table border="0" cellpadding="0" cellspacing="0">
		<tr>
			<th align="left">
				<h2><?= $this->data['Content']['name']?></h2> 
			</th>
		</tr>
		<tr>
			<td width="550" align="left" valign="top" class="text">
			<div id="tabs">
				<ul>
					<li><a href="#tabs-1">Armenian</a></li>
					<li><a href="#tabs-2">Russian</a></li>
					<li><a href="#tabs-3">English</a></li>
				</ul>
				<div id="tabs-1">
					<?php echo $form->input('Content.arm', array('label'=>'<span class="text_red">Armenian version: </span><br />', 'rows'=>20, 'style'=>'width:550px'));?>
					<br />
					<?php echo $form->input('Content.title_arm', array('label'=>'Title in Armenian version:<br />', 'style'=>'width:550px'));?>
					<br />
					<?php echo $form->input('Content.keywords_arm', array('label'=>'Keywords in Armenian version:<br />', 'style'=>'width:550px', 'rows'=>2));?>
					<br />
					<?php echo $form->input('Content.description_arm', array('label'=>'Description in Armenian version:<br />', 'style'=>'width:550px', 'rows'=>2));?>
					<br /><br />
			  	</div>
				<div id="tabs-2">
					<?php echo $form->input('Content.rus', array('label'=>'<span class="text_red">Russion version: </span><br />', 'rows'=>20, 'style'=>'width:550px'));?>
					<br />
					<?php echo $form->input('Content.title_rus', array('label'=>'Title in Russion version:<br />', 'style'=>'width:550px'));?>
					<br />
					<?php echo $form->input('Content.keywords_rus', array('label'=>'Keywords in Russion version:<br />', 'style'=>'width:550px', 'rows'=>2));?>
					<br />
					<?php echo $form->input('Content.description_rus', array('label'=>'Description in Russion version:<br />', 'style'=>'width:550px', 'rows'=>2));?>
					<br /><br />
				</div>
				<div id="tabs-3">
					<?php echo $form->input('Content.eng', array('label'=>'<span class="text_red">English version: </span><br />', 'rows'=>20, 'style'=>'width:550px'));?>
					<br />
					<?php echo $form->input('Content.title_eng', array('label'=>'Title in English version:<br />', 'style'=>'width:550px'));?>
					<br />
					<?php echo $form->input('Content.keywords_eng', array('label'=>'Keywords in English version:<br />', 'style'=>'width:550px', 'rows'=>2));?>
					<br />
					<?php echo $form->input('Content.description_eng', array('label'=>'Description in English version:<br />', 'style'=>'width:550px', 'rows'=>2));?>
					<br /><br />
				</div>
			</div>
				<?php echo $form->input('Content.id')?>

				<input type="submit" name="Save" value="Save"/>
				<input type="reset" name="Reset" value="Reset" />
				
			</td>
			<td valign="top" align="right" width="100%">
				<br />
				<table border="1" cellspacing="0" cellpadding="0">
				  <? $term = 1;
				  		foreach ($rightblocks as $curblock) { 
				  ?>
				  <tr>
					<td >&nbsp;<? echo $curblock; ?>&nbsp;</td>
					<td height="30">
						<input name="<? echo $curblock; ?>" type="checkbox" value="<? echo $term; $term++; ?>" checked="checked" />
						<? if ($curblock != $rightblocks[count($rightblocks)-1]) { ?><a href="<?=APP_ROOT?>/contents/changeBlocksTerm/<?=$curblock;?>/<?=$this->data['Content']['name']?>"><img border="0" src="<?=APP_ROOT;?>/img/icons/Colored/GIF/arrow_down.gif" /></a><? } ?>
					</td>
				  </tr>
				  <?     	
				  		} //foreach
				  $query = mysql_query("SELECT * FROM contents WHERE is_block = 1");
				  $num_query = mysql_num_rows($query);
				  for($j=0; $j<$num_query; $j++){
				  	$name = mysql_result($query, $j, "name");
					if (!in_array($name, $rightblocks) ) { 
				  ?>
				  <tr>
					<td>&nbsp;<? echo $name; ?>&nbsp;</td>
					<td><input name="<? echo $name; ?>" type="checkbox" value="<? echo $term; $term++; ?>" /></td>
				  </tr>
				  <? } //if
				  }//for
				  ?>
				</table>
		  </td>
		</tr>
	</table>
<?php echo $form->end();?>